
<div class="container">
	<div class="row">
		<div class="col-sm-8">
			<a class="navbar-brand navbar-title" href="#">Edit Company</a>
		</div>
	</div>
	<div class="row">
		<div class="col-sm-8">
			<div id="message"></div>
                 <?php echo form_open("company/edit_company"); ?>
                 <?php
					foreach ( $groups as $row ) {
			
						$telarray=explode('-',$row->tel_number);
						
						$contactarray=explode('-',$row->contact_number);
						
						$faxarray=explode('-',$row->fax);
						
				?>	
                    <div class="contact-form">
				<div class="row">
					<div class="col-sm-6">
						<label for="con_name">Company Name :</label> 
							<input name="name" type="text" class="form-control contact-input animate" id="name"
							value="<?php echo $row->name; ?>" class="form-control contact-input" placeholder="Company Name">
							<?php echo form_error('name', '<div class="error">', '</div>'); ?>
                            <input type="hidden" name="company_id" value="<?php echo $row->company_id; ?>" />
					</div>
				</div>
				<div class="row">
					<div class="col-sm-6">
						<label for="con_name">Email :</label> 
							<input name="email" type="text" id="email" class="form-control contact-input animate"
							placeholder="Email" value="<?php echo $row->email; ?>" />
							<?php echo form_error('email', '<div class="error">', '</div>'); ?>
                   </div>
				</div>
				<div class="row">
					<div class="col-sm-6">
						<label>Tel Number :</label> 
							<input name="tel_number1" size="4" class="numeric  contact-input animate" type="text" 
							maxlength="4" value="<?php echo $telarray[0]; ?>" />- 
							<input name="tel_number2" size="4" class="numeric  contact-input animate" type="text"
							maxlength="4" value="<?php echo $telarray[1]; ?>" />- 
							<input name="tel_number3" size="4" class="numeric  contact-input animate" type="text" 
							maxlength="4" value="<?php echo $telarray[2]; ?>" />
							<?php echo form_error('tel_number1', '<div class="error">', '</div>'); ?>
							<?php echo form_error('tel_number2', '<div class="error">', '</div>'); ?>
							<?php echo form_error('tel_number3', '<div class="error">', '</div>'); ?>
                   </div>
				</div>
				<div class="row">
					<div class="col-sm-6">
						<label>Fax Number</label> 
							<input name="fax1" size="4" class="numeric  contact-input animate" type="text" 
							maxlength="4" value="<?php echo $faxarray[0]; ?>" />- 
							<input name="fax2" size="4" class="numeric  contact-input animate" type="text"
							maxlength="4" value="<?php echo $faxarray[1]; ?>" />- 
							<input name="fax3" size="4" class="numeric  contact-input animate" type="text" 
							maxlength="4" value="<?php echo $faxarray[2]; ?>" />
         					<?php echo form_error('fax1', '<div class="error">', '</div>'); ?>
         					<?php echo form_error('fax2', '<div class="error">', '</div>'); ?>
         					<?php echo form_error('fax3', '<div class="error">', '</div>'); ?>
                   </div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<label for="con_name">Address :</label>
						<textarea id="address" rows="10" placeholder="Address" class="form-control contact-textarea" 
						name="address"><?php echo $row->address; ?></textarea>
						<?php echo form_error('address', '<div class="error">', '</div>'); ?>
	  				</div>
				</div>
				<div class="row">
					<div class="col-sm-6">
						<label for="con_name">Account User :</label> 
							<input name="account_user" type="text" id="account_user" class="form-control contact-input animate"
							placeholder="Account User" value="<?php echo $row->account_user; ?>" />
							<?php echo form_error('account_user', '<div class="error">', '</div>'); ?>
                   </div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<label for="con_name">Province : 
							<input type="text" id="province" name="province" class="form-control contact-input animate"
							disabled value="<?php echo $row->PROVINCE_NAME; ?>" />
						</label> 
						<label for="con_name">District: 
							<input type="text" id="district" name="district" class="form-control contact-input animate"
							disabled value="<?php echo $row->district_NAME; ?>" />
						</label>
					</div>
				</div>
						<?php
								$i=2;
								foreach ( $branch as $branch ) {
						?>
				<div class="row">
					<div class="col-sm-12">
						<label for="con_name">Province Branch<?php echo $i; ?> :
		                	<input type="text" id="pro_branch" name="pro_branch" class="form-control contact-input animate"
							disabled value="<?php echo $branch->PROVINCE_NAME; ?>" />
						</label>
						<label for="con_name">District Branch<?php echo $i; ?> :
		                	<input type="text" id="dis_branch" name="dis_branch" class="form-control contact-input animate"
							disabled value="<?php echo $branch->district_NAME; ?>" />
						</label>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<label for="con_name">Area Detail<?php echo $i; ?> :</label>
						<textarea id='area_detail' rows='10' placeholder='Area Detail' class='form-control contact-textarea' 
						disabled name='area_detail'><?php echo $branch->construction_area_details; ?></textarea>
					</div>
				</div>
						<?php 
							$i++;	}
						
						?>
						
				<div class="row">
					<div class="col-sm-6">
						<label for="con_name">Contact Name :</label> 
							<input name="con_name" type="text" id="con_name" class="form-control contact-input animate"
							placeholder="Contact Name" value="<?php echo $row->contact_name; ?>" />
							<?php echo form_error('con_name', '<div class="error">', '</div>'); ?>
                	</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<label>Contact Number</label> 
							<input name="con_tel1" size="4" class="numeric  contact-input animate" type="text" maxlength="4"
							value="<?php echo $contactarray[0]; ?>" />- 
							<input name="con_tel2" size="4" class="numeric  contact-input animate" type="text" maxlength="4" 
							value="<?php echo $contactarray[1]; ?>" />-
							<input name="con_tel3" size="4" class="numeric  contact-input animate" type="text" maxlength="4"
							value="<?php echo $contactarray[2]; ?>" />
         					<?php echo form_error('con_tel1', '<div class="error">', '</div>'); ?>
         					<?php echo form_error('con_tel2', '<div class="error">', '</div>'); ?>
         					<?php echo form_error('con_tel3', '<div class="error">', '</div>'); ?>
                	</div>
				</div>

			
                     <?php } ?>
                     
          	 <div class="row">
				<div class="col-sm-12">
					<div class="pull-left clearfix">
						<button type="submit" id="submit" class="submit-btn active-btn">Save Edit</button>
						<button type="button" id="submit" class="submit-btn active-btn" onclick="history.go(-1);">Back</button>
					</div>
				</div>
			</div>
			</div>
                 <?php echo form_close(); ?>
            </div>

		<div class="col-sm-4"></div>
	</div>
</div>
